package com.confidena

import com.confidena.security.Person

class AccountOperation {
	Integer credit
	Integer type
	Date date
	static belongsTo = [personGame:PersonGame, person:Person, fatherOperation:AccountOperation]

	/*
	 * types:
	 * 1. Ingreso x Juego
	 * 2. Egreso x Juego
	 * 3. Ingreso x carga de credito
	 * 4. Egreso x extracción
	 * 5. Egreso x compra
	 * 
	 */
	
    static constraints = {
		personGame nullable:true
		fatherOperation nullable:true
    }
	
	String toString() {
		"${type}-${person}-${personGame}"
	}
}
